-
Notifications
You must be signed in to change notification settings - Fork 65
starknet_os_runner: class provider #10939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fc227e2 to
bed279a
Compare
042c72c to
ef84d39
Compare
bed279a to
041b6a6
Compare
ef84d39 to
e7090da
Compare
aaab0d0 to
29a4c1b
Compare
e7090da to
2128dc4
Compare
29a4c1b to
35ccc69
Compare
2128dc4 to
c7c4b2e
Compare
meship-starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@meship-starkware partially reviewed 5 files.
Reviewable status: 2 of 5 files reviewed, all discussions resolved (waiting on @avi-starkware and @noaov1).
meship-starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@meship-starkware made 1 comment.
Reviewable status: 2 of 5 files reviewed, all discussions resolved (waiting on @avi-starkware and @noaov1).
35ccc69 to
13133aa
Compare
c7c4b2e to
b626b52
Compare
Yoni-Starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yoni-Starkware reviewed 2 files and all commit messages, and made 2 comments.
Reviewable status: 2 of 8 files reviewed, 2 unresolved discussions (waiting on @avi-starkware, @AvivYossef-starkware, @meship-starkware, and @noaov1).
crates/starknet_os_runner/src/virtual_block_executor_test.rs line 68 at r4 (raw file):
// Calldata for account's __execute__ (Cairo 0 OZ account format): // [call_array_len, call_array..., calldata_len, calldata...]
Remove this struct and add `execution_flag to the original RPC struct (with default values)
Code quote:
/// Test wrapper for RpcStateReader that overrides execution flags to skip validation.
struct TestRpcVirtualBlockExecutor(RpcVirtualBlockExecutor);
impl VirtualBlockExecutor for TestRpcVirtualBlockExecutor {
fn block_context(
&self,
block_number: BlockNumber,
) -> Result<blockifier::context::BlockContext, VirtualBlockExecutorError> {
self.0.block_context(block_number)
}
fn state_reader(
&self,
block_number: BlockNumber,
) -> Result<
impl blockifier::state::state_reader_and_contract_manager::FetchCompiledClasses
+ Send
+ Sync
+ 'static,
VirtualBlockExecutorError,
> {
self.0.state_reader(block_number)
}
// Override the default implementation to skip validation.
fn convert_invoke_txs(
txs: Vec<(Transaction, TransactionHash)>,
) -> Result<Vec<BlockifierTransaction>, VirtualBlockExecutorError> {
// Call the default trait implementation.
let mut blockifier_txs = RpcVirtualBlockExecutor::convert_invoke_txs(txs)?;
// Modify validate flag to false for all transactions.
for tx in &mut blockifier_txs {
if let BlockifierTransaction::Account(account_tx) = tx {
account_tx.execution_flags.validate = false;
}
}
Ok(blockifier_txs)
}
}
/// Constructs an Invoke transaction that calls `balanceOf` on the STRK token contract.
///
/// Since we skip validation and fee charging, we can use dummy values for signature,
/// nonce, and resource bounds.
fn construct_balance_of_invoke() -> (Transaction, TransactionHash) {
let strk_token = ContractAddress::try_from(STRK_TOKEN_ADDRESS).unwrap();
let sender = ContractAddress::try_from(SENDER_ADDRESS).unwrap();
// Calldata for account's __execute__ (Cairo 0 OZ account format):
// [call_array_len, call_array..., calldata_len, calldata...]crates/starknet_os_runner/src/test_utils.rs line 1 at r4 (raw file):
use std::env;
How is this related to the class provider?
Yoni-Starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yoni-Starkware resolved 1 discussion.
Reviewable status: 2 of 8 files reviewed, 1 unresolved discussion (waiting on @avi-starkware, @AvivYossef-starkware, @meship-starkware, and @noaov1).
b626b52 to
20aa4d0
Compare
Yoni-Starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yoni-Starkware resolved 1 discussion.
Reviewable status: 2 of 8 files reviewed, 1 unresolved discussion (waiting on @avi-starkware, @AvivYossef-starkware, @meship-starkware, and @noaov1).
AvivYossef-starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AvivYossef-starkware made 1 comment.
Reviewable status: 2 of 8 files reviewed, 1 unresolved discussion (waiting on @avi-starkware, @meship-starkware, @noaov1, and @Yoni-Starkware).
crates/starknet_os_runner/src/virtual_block_executor_test.rs line 68 at r4 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
Remove this struct and add `execution_flag to the original RPC struct (with default values)
It's not part of the PR,
you saw it since the branch wasn't rebased.
I made the changes you asked in #11129
20aa4d0 to
19edbe7
Compare
Yoni-Starkware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yoni-Starkware reviewed 6 files and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @avi-starkware and @noaov1).

No description provided.